import { handleData } from '@/util/data'
import { post } from '@http/index'

// disabled
// type
const option = [
  ['value', 'parent', 'text', 'value', 'is_lang'],
  ['id', 'pid', 'label', 'value', 'langtype']
]

//token
//selectKey langs
export const getOptionData = async (...args) => {
  const { code, data, cancelMessage } = await post('/getOptionsByKey', ...args)
  if (data) return { code, data: handleData(data, option), cancelMessage }
  return { code, cancelMessage }
}
